<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <div style="background:gray; width:100px; height:100px; position:relative;">
        <div id="d" style="background:black; position:absolute; left:10px; right:10px; top:10px; bottom:10px; color:white;">test</div>
    </div>
</body>
</html>